#ifndef INTERFACE_EVENT_HPP
#define INTERFACE_EVENT_HPP

#include "GlobalDefines.hpp"


namespace mi
{
    class Widget;
    
    class Event
    {
    public:
        Event (Widget *cause, Vec2i mousePosition);

        Widget* SourceWidget ();
        
        Vec2i MousePos ();
    
    private:
        Widget *sourceWidget;
        
        Vec2i mouseCoords;
    };

    // this class should be extended by objects that wish to get callbacks from any Widget that support them
    class Callable
    {    
    public:
        virtual void EventCallback(Event e) = 0;
    };

}

// definitions to make this simpler
#define CALL_MEMBER_FUNCTION(object, ptrToMember)  ((object)->*(ptrToMember))

typedef void (mi::Callable::*CallableFunction)(mi::Event e);

#endif